\hypertarget{bus__usart_8h}{
\section{wmv\_\-bus/bus\_\-usart.h File Reference}
\label{bus__usart_8h}\index{wmv\_\-bus/bus\_\-usart.h@{wmv\_\-bus/bus\_\-usart.h}}
}
BUS usart routines.  


\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned char \hyperlink{bus__usart_8h_3f4c9e9ec901a903e3f1792523e7460a}{bus\_\-poll\_\-usart\_\-receive} (void)
\begin{CompactList}\small\item\em Retrieve one character from the USART Retrieve one character from the USART. With this function you will need to poll the USART, it does NOT wait until a character is in the buffer. \item\end{CompactList}\item 
void \hyperlink{bus__usart_8h_5f0672d32c864d46e4818aa392afd2f7}{bus\_\-usart\_\-init} (unsigned int baudrate)
\begin{CompactList}\small\item\em Initiliaze the USART for the communication bus This function is used to initialize the USART which a baudrate that needs to be sent in as a parameter Use the baudrate settings specified in the uCs datasheet. \item\end{CompactList}\item 
unsigned char \hyperlink{bus__usart_8h_ecbcec880106aa7625443db2aa49dc84}{bus\_\-usart\_\-transmit} (unsigned char data)
\begin{CompactList}\small\item\em Send a character to the USART Send a single character to the USART used for the communication bus. \item\end{CompactList}\item 
unsigned char \hyperlink{bus__usart_8h_0cfca672d8febd09686f229e01bd879e}{bus\_\-usart\_\-receive} (void)
\begin{CompactList}\small\item\em Retrieve one character from the USART Retrieve one character from the USART. This function will wait until there is a character in the USART RX buffer. \item\end{CompactList}\item 
unsigned char \hyperlink{bus__usart_8h_7fb8788299c55695476d83ef53735269}{bus\_\-usart\_\-receive\_\-loopback} (void)
\begin{CompactList}\small\item\em The USART recieve loopback This function does wait for a character in the RX buffer and returns it to the transmit buffer. \item\end{CompactList}\item 
unsigned char \hyperlink{bus__usart_8h_2c0069814ab5b28cbc774ce69f872cf2}{bus\_\-usart\_\-sendstring} (char $\ast$data, unsigned char length)
\begin{CompactList}\small\item\em Send a string of characters to the USART Send a string of characters to the USART used for the communication bus. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
BUS usart routines. 

\begin{Desc}
\item[Author:]Mikael Larsmark, SM2WMV \end{Desc}
\begin{Desc}
\item[Date:]2010-01-25 

\begin{Code}\begin{verbatim} #include "wmv_bus/bus_usart.h" 
\end{verbatim}
\end{Code}

 \end{Desc}


Definition in file \hyperlink{bus__usart_8h-source}{bus\_\-usart.h}.

\subsection{Function Documentation}
\hypertarget{bus__usart_8h_3f4c9e9ec901a903e3f1792523e7460a}{
\index{bus\_\-usart.h@{bus\_\-usart.h}!bus\_\-poll\_\-usart\_\-receive@{bus\_\-poll\_\-usart\_\-receive}}
\index{bus\_\-poll\_\-usart\_\-receive@{bus\_\-poll\_\-usart\_\-receive}!bus_usart.h@{bus\_\-usart.h}}
\subsubsection[{bus\_\-poll\_\-usart\_\-receive}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char bus\_\-poll\_\-usart\_\-receive (void)}}
\label{bus__usart_8h_3f4c9e9ec901a903e3f1792523e7460a}


Retrieve one character from the USART Retrieve one character from the USART. With this function you will need to poll the USART, it does NOT wait until a character is in the buffer. 

\begin{Desc}
\item[Returns:]The character from the RX USART buffer \end{Desc}


Definition at line 301 of file bus\_\-usart.c.\hypertarget{bus__usart_8h_5f0672d32c864d46e4818aa392afd2f7}{
\index{bus\_\-usart.h@{bus\_\-usart.h}!bus\_\-usart\_\-init@{bus\_\-usart\_\-init}}
\index{bus\_\-usart\_\-init@{bus\_\-usart\_\-init}!bus_usart.h@{bus\_\-usart.h}}
\subsubsection[{bus\_\-usart\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void bus\_\-usart\_\-init (unsigned int {\em baudrate})}}
\label{bus__usart_8h_5f0672d32c864d46e4818aa392afd2f7}


Initiliaze the USART for the communication bus This function is used to initialize the USART which a baudrate that needs to be sent in as a parameter Use the baudrate settings specified in the uCs datasheet. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em baudrate}]The baudrate param from the ATMEGA32 datasheet. \end{description}
\end{Desc}


Definition at line 34 of file bus\_\-usart.c.

Referenced by bus\_\-init().\hypertarget{bus__usart_8h_0cfca672d8febd09686f229e01bd879e}{
\index{bus\_\-usart.h@{bus\_\-usart.h}!bus\_\-usart\_\-receive@{bus\_\-usart\_\-receive}}
\index{bus\_\-usart\_\-receive@{bus\_\-usart\_\-receive}!bus_usart.h@{bus\_\-usart.h}}
\subsubsection[{bus\_\-usart\_\-receive}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char bus\_\-usart\_\-receive (void)}}
\label{bus__usart_8h_0cfca672d8febd09686f229e01bd879e}


Retrieve one character from the USART Retrieve one character from the USART. This function will wait until there is a character in the USART RX buffer. 

\begin{Desc}
\item[Returns:]The character from the RX USART buffer \end{Desc}


Definition at line 181 of file bus\_\-usart.c.\hypertarget{bus__usart_8h_7fb8788299c55695476d83ef53735269}{
\index{bus\_\-usart.h@{bus\_\-usart.h}!bus\_\-usart\_\-receive\_\-loopback@{bus\_\-usart\_\-receive\_\-loopback}}
\index{bus\_\-usart\_\-receive\_\-loopback@{bus\_\-usart\_\-receive\_\-loopback}!bus_usart.h@{bus\_\-usart.h}}
\subsubsection[{bus\_\-usart\_\-receive\_\-loopback}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char bus\_\-usart\_\-receive\_\-loopback (void)}}
\label{bus__usart_8h_7fb8788299c55695476d83ef53735269}


The USART recieve loopback This function does wait for a character in the RX buffer and returns it to the transmit buffer. 

\begin{Desc}
\item[Returns:]The character from the RX USART buffer \end{Desc}


Definition at line 232 of file bus\_\-usart.c.

References bus\_\-usart\_\-transmit().\hypertarget{bus__usart_8h_2c0069814ab5b28cbc774ce69f872cf2}{
\index{bus\_\-usart.h@{bus\_\-usart.h}!bus\_\-usart\_\-sendstring@{bus\_\-usart\_\-sendstring}}
\index{bus\_\-usart\_\-sendstring@{bus\_\-usart\_\-sendstring}!bus_usart.h@{bus\_\-usart.h}}
\subsubsection[{bus\_\-usart\_\-sendstring}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char bus\_\-usart\_\-sendstring (char $\ast$ {\em data}, \/  unsigned char {\em length})}}
\label{bus__usart_8h_2c0069814ab5b28cbc774ce69f872cf2}


Send a string of characters to the USART Send a string of characters to the USART used for the communication bus. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]The string of characters you wish to send \item[{\em length}]The length of the string you wish to send \end{description}
\end{Desc}


Definition at line 168 of file bus\_\-usart.c.

References bus\_\-usart\_\-transmit().\hypertarget{bus__usart_8h_ecbcec880106aa7625443db2aa49dc84}{
\index{bus\_\-usart.h@{bus\_\-usart.h}!bus\_\-usart\_\-transmit@{bus\_\-usart\_\-transmit}}
\index{bus\_\-usart\_\-transmit@{bus\_\-usart\_\-transmit}!bus_usart.h@{bus\_\-usart.h}}
\subsubsection[{bus\_\-usart\_\-transmit}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char bus\_\-usart\_\-transmit (unsigned char {\em data})}}
\label{bus__usart_8h_ecbcec880106aa7625443db2aa49dc84}


Send a character to the USART Send a single character to the USART used for the communication bus. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]The character you want to send \end{description}
\end{Desc}


Definition at line 116 of file bus\_\-usart.c.

Referenced by bus\_\-send\_\-message(), bus\_\-usart\_\-receive\_\-loopback(), and bus\_\-usart\_\-sendstring().